<script type="text/javascript">
$(document).ready(function()
				{
				$(".text").blur(function(){
											$cellvalue = $(".cellvalue").val();
											$tong =$('.tong'+$(this).get(0).id).val();
											$value=$(this).val();
											$cellvalue = parseInt($cellvalue,10);
											$tong =parseInt($tong,10);
											$value=parseInt($value,10);
											if (isNaN($cellvalue))
												$cellvalue=0;
											if (isNaN($tong))
												$tong=0;
											if (isNaN($value))
											{
												$value=0;
												$(this).val(0);
											}
											$tong = $tong + $value - $cellvalue;
											$('.tong'+$(this).get(0).id).val($tong);
										});

				$(".text").focus(function(){
					$(".cellvalue").val($(this).val());
				});
				
				$(".text").keydown(function(e) {
					arr_key = new Array();
					arr_key[8]=8;
					arr_key[9]=9;
					arr_key[35]=35;
					arr_key[36]=36;
					arr_key[37]=37;
					arr_key[39]=39;
					arr_key[46]=46;
			        if ( arr_key[e.keyCode]!==undefined) {}
			        else {
			            if (e.keyCode < 48 || e.keyCode > 57 ) {
			                e.preventDefault(); 
			            }   
			        }
			    });
				}
	);

</script>
<div id="tabs">
	<ul>
        <li><?php echo $this->Html->link(__('Chỉ tiêu', true), array('controller' => 'chitieunvs', 'action' => 'hienchitieu',$kehoach_id)); ?> </li>
        <li id="current"><?php echo $this->Html->link(__('Sửa chỉ tiêu', true), array('controller'=>'chitieunvs','action' => 'suachitieu',$kehoach_id));?></li>
        <li><?php echo $this->Html->link(__('Các thời gian giao khác', true), array('controller'=>'kehoaches','action' => 'giaochitieu',$this->Session->read('cur_dv')));?></li>
        <li></li>
	</ul>
</div>
<div class="kqbanhangs form">

<?php
	if(isset($col_ctdv) && isset($row_ctdv) && isset($datadv) && isset($datadc))
	{
		echo "<h3>Kế Hoạch Của Trung Tâm: ".$thoigian[key($thoigian)] . "</h3>";
		echo $ctable->show_2_table($col1,$col_ctdv,$row_ctdv,$datadc,$datadv); 
	}
?>

<?php echo $this->Form->create('Chitieunv',array('url'=>'luuchitieu/'.$kehoach_id));?>
<?php
	echo "</br><h3>Lập Kế Hoạch Cho Nhân Viên</h3>";
	if (isset($datanvsl) && isset($datanvid)) 
    	echo $ctable->edittable('Chitieunv',$col_ctnv,$row_ctnv,$datanvsl,$datanvid);
?>
<?php echo $this->Form->end(__('  Lưu  ', true));?>

</div>